<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>鼠标悬浮事件</title>
    <style>
        div{
            height: 80px;
            border: 1px solid black;
        }

    </style>
    <script>
        function show(){
            document.getElementById("one").style.backgroundColor = "#999";
            console.log("进入")
        }

        function unshow(){
            document.getElementById("one").style.backgroundColor = "#fff";
            console.log("离开")
        }
    </script>
</head>
<body>
    <div onmouseenter="show()" onmouseleave="unshow()" id="one"></div>
</body>
</html>